package com.dlc.shop.seckill.common.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 秒杀信息
 *
 * @author LGH
 * @date 2019-08-28 09:36:59
 */
@Data
@TableName("tz_seckill")
public class Seckill implements Serializable{
    private static final long serialVersionUID = 1L;

    @TableId
    @Schema(description = "秒杀活动id" , requiredMode = Schema.RequiredMode.REQUIRED)
    private Long seckillId;

    @Schema(description = "商品id" , requiredMode = Schema.RequiredMode.REQUIRED)
    private Long prodId;

    @NotNull
    @Schema(description = "活动名称" , requiredMode = Schema.RequiredMode.REQUIRED)
    private String seckillName;

    @NotNull
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "开始时间" , requiredMode = Schema.RequiredMode.REQUIRED)
    private Date startTime;

    @NotNull
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "结束时间" , requiredMode = Schema.RequiredMode.REQUIRED)
    private Date endTime;

    @Schema(description = "活动标签" , requiredMode = Schema.RequiredMode.REQUIRED)
    private String seckillTag;

    @Schema(description = "限购数量" , requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer maxNum;

    @Schema(description = "取消订单时间" , requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer maxCancelTime;

    @Schema(description = "店铺id" , requiredMode = Schema.RequiredMode.REQUIRED)
    private Long shopId;

    @Schema(description = "是否已删除 0 未删除 1已删除" , requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer isDelete;

    @Schema(description = "状态：0 失效 1正常" , requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer status;

    @Schema(description = "秒杀活动剩余库存" , requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer seckillTotalStocks;

    @Schema(description = "秒杀活动原始库存" , requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer seckillOriginStocks;

    @Schema(description = "秒杀活动最低价" , requiredMode = Schema.RequiredMode.REQUIRED)
    private Double seckillPrice;

    @TableField(exist = false)
    @Schema(description = "店铺名称" )
    private String shopName;

    @Schema(description = "0不补充 1补充库存")
    private Integer replenish;
}
